package xuesm.singleton.hungry;

/**
 * @Author: xuesm
 * @Description: 饿汉式单例
 * @Date: Create in 12:59 2019/3/27
 */
public class HungrySingleton {

	// 私有属性防止通过new 创建对象
	private HungrySingleton(){};

	// 加final是为了防止修改
	private static final HungrySingleton HUNGRY_SINGLETON = new HungrySingleton();

	public static HungrySingleton getInstance(){
		return HUNGRY_SINGLETON;
	}
}
